package Y2024.M12.D5;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-12-05
 * Time: 8:57
 */
public class Main2 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread1=new Thread(new printNumberTask1("q",1));
        Thread thread2=new Thread(new printNumberTask2("w",2));
        Thread thread3=new Thread(new printNumberTask3("e",3));
        thread1.start();
        thread2.start();
        thread3.start();
        thread3.join();
        thread2.join();
    }
}
class printNumberTask1 implements Runnable{
    String name;
    int number;
    printNumberTask1(String name, int number){
        this.name=name;
        this.number=number;
    }
    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(name+":"+number);
        }
    }
}
class printNumberTask2 implements Runnable{
    String name;
    int number;
    printNumberTask2(String name, int number){
        this.name=name;
        this.number=number;
    }
    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(name+":"+number);
        }
    }
}
class printNumberTask3 implements Runnable{
    String name;
    int number;
    printNumberTask3(String name, int number){
        this.name=name;
        this.number=number;
    }
    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(name+":"+number);
        }
    }
}